<?php

namespace App\Service\H5;

use App\Constants\ErrorCode;
use App\Model\ComplaintLab;
use App\Model\User;
use App\Service\BaseService;
use App\Helpers\AliyunUtil;
/**
 * 上传图片
 */
class UpdateImgService extends BaseService
{
    public function handle()
    {
        $userId = $this->getUserId() ;
        //是否管理员权限
        if (!User::isSuperAdmin($userId)) {
            return $this->setError(ErrorCode::OP_NOT_VALID, '暂无操作权限');
        }
        $files = $this->request->file('img');
        return AliyunUtil::uploadImgRemote($files);
    }
}
